<?
if (!defined('baseinfo')) {
    exitdata();
}   
?>
<script>
showRecaptcha('recaptchacontact');
 function savecontactdata()
 {
 
 
 
var checkerror=new Array();
var rowerror=0;
var datasend={};

if($('input[name="namecontact"]').val()=="")
{
     alertwrongboxmsgonly("Please request field input");
     $('input[name="namecontact"]').focus();
     return false;
     //checkerror[rowerror++]={msg:"Please request field input",code:4,obj:$('input[name="susername"]')};
     

}
else
{
     datasend['namecontact']=$('input[name="namecontact"]').val();

}




if($('input[name="emailcontact"]').val()=="")
{
     alertwrongboxmsgonly("Please request field input");
     $('input[name="emailcontact"]').focus();
     return false;
     //checkerror[rowerror++]={msg:"Please request field input",code:4,obj:$('input[name="susername"]')};
     

}
else
{
     datasend['emailcontact']=$('input[name="emailcontact"]').val();

}



if($('input[name="titlecontact"]').val()=="")
{
     alertwrongboxmsgonly("Please request field input");
     $('input[name="titlecontact"]').focus();
     return false;
     //checkerror[rowerror++]={msg:"Please request field input",code:4,obj:$('input[name="susername"]')};
     

}
else
{
     datasend['titlecontact']=$('input[name="titlecontact"]').val();

}




if($('textarea[name="messagecontact"]').val()=="")
{
     alertwrongboxmsgonly("Please request field input");
     $('textarea[name="messagecontact"]').focus();
     return false;
     //checkerror[rowerror++]={msg:"Please request field input",code:4,obj:$('input[name="susername"]')};
     

}
else
{
     datasend['messagecontact']=$('textarea[name="messagecontact"]').val();

}


if($('input[name="recaptcha_response_field"]').val()=="")
{
     alertwrongboxmsgonly("Please request field input");
     $('input[name="recaptcha_response_field"]').focus();
     return false;
     //checkerror[rowerror++]={msg:"Please request field input",code:4,obj:$('input[name="susername"]')};
     

}
else
{
     datasend['recaptchac']=$('input[name="recaptcha_challenge_field"]').val();
     datasend['recaptcha']=$('input[name="recaptcha_response_field"]').val();

}




if(checkerror.length==0)
{
loaddata();
$.post(serviceinfo+"savecontact",datasend,
function(data){
loadclosedata();
if(data.error.response)
{

alertbox(data.error.error);

}else
{
boxmsgdata('Success');
//location.href=baseinfo;


}


});


}else
{

//alertboxtext(checkerror,$("#validateerror-login"));

}
 
 
 }

</script>


